package com.feng.webflux.reactor8;

import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Stream;

public class TestReactor {
    public static void main(String[] args) {
        Flux.just(1);
        Flux.just(1,2,3,4).subscribe(System.out::println);
        Mono.just(1).subscribe(System.out::print);

        //其他方法
        Integer[] arr = {0,1,2,3};
        Flux.fromArray(arr);

        List<Integer> integers = Arrays.asList(arr);
        Flux.fromIterable(integers);

        Stream<Integer> stream = integers.stream();
        Flux.fromStream(stream);
    }
}
